const calculate = (args)=>{
  let sum = 0
  for (let i = 0; i < args.length; i++) {
    sum = -args[i] * Math.log2(args[i]) + sum
  }
  sum = sum.toFixed(3)
  console.log(`H(p) = ${sum} bits`);
}

module.exports = calculate;